package com.minimalist.common.entity.basic.vo.file;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.config.convert.LongArrJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @author 11987
 */
@Schema(name = "文件状态更新实体")
public class FileUpdateStatusVO implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "用户id", description = "用户id", type = "string")
    @NotNull(message = "用户id不能为空")
    Long userId;

    @JsonSerialize(using = LongArrJsonSerializer.class)
    @Schema(name = "文件url列表", description = "文件id列表", type = "string")
    @NotNull(message = "文件url列表不能为空")
    @NotEmpty(message = "文件url列表不能为空")
    List<String> fileUrlList;

    @Schema(name = "文件状态", description = "文件状态", type = "integer")
    @NotNull(message = "文件状态不能为空")
    Integer fileStatus;

    public FileUpdateStatusVO() {
    }

    public FileUpdateStatusVO(Long userId, List<String> fileUrlList, Integer fileStatus) {
        this.userId = userId;
        this.fileUrlList = fileUrlList;
        this.fileStatus = fileStatus;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public List<String> getFileUrlList() {
        return fileUrlList;
    }

    public void setFileUrlList(List<String> fileUrlList) {
        this.fileUrlList = fileUrlList;
    }

    public Integer getFileStatus() {
        return fileStatus;
    }

    public void setFileStatus(Integer fileStatus) {
        this.fileStatus = fileStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FileUpdateStatusVO that = (FileUpdateStatusVO) o;
        return java.util.Objects.equals(userId, that.userId) &&
               java.util.Objects.equals(fileUrlList, that.fileUrlList) &&
               java.util.Objects.equals(fileStatus, that.fileStatus);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(userId, fileUrlList, fileStatus);
    }

    @Override
    public String toString() {
        return "FileUpdateStatusVO{" +
               "userId=" + userId +
               ", fileUrlList=" + fileUrlList +
               ", fileStatus=" + fileStatus +
               '}';
    }
}
